<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>样式动态绑定</title>
		<script src="vue.js"></script>
	</head>

	<body>
		<div id="app">
			<div v-bind:style="{backgroundColor:pink,width:myWdith,height:myHeight}">

			</div>
			<div v-bind:style="myDiv"></div>
		</div>

		<script>
			var vm = new Vue({
				el: "#app",
				data: {
					myDiv: {
						backgroundColor: 'red',
						width: '100%',
						height: '100px'
					},
					pink: 'pink',
					myWdith: '100%',
					myHeight: '200px'
				}
			})
		</script>
	</body>

</html>